package cn.iocoder.yudao.module.common.dal.mysql.gradesubjectrelation;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.common.dal.dataobject.gradesubjectrelation.GradeSubjectRelationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.common.controller.admin.gradesubjectrelation.vo.*;

/**
 * 年级学科 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface GradeSubjectRelationMapper extends BaseMapperX<GradeSubjectRelationDO> {

    default PageResult<GradeSubjectRelationDO> selectPage(GradeSubjectRelationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<GradeSubjectRelationDO>()
                .eqIfPresent(GradeSubjectRelationDO::getGradeId, reqVO.getGradeId())
                .eqIfPresent(GradeSubjectRelationDO::getSubjectId, reqVO.getSubjectId())
                .betweenIfPresent(GradeSubjectRelationDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(GradeSubjectRelationDO::getVersion, reqVO.getVersion())
                .orderByDesc(GradeSubjectRelationDO::getId));
    }

}